package com.bd.learning.autocreateid.zk;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class Test {

    private static final Log log = LogFactory.get();

    public static void main(String[] args) throws Exception {

        ZookeeperClient zc = new ZookeeperClient("192.168.0.4", "/incrid/t2");
        zc.init();
        TimeInterval timer = DateUtil.timer();
        timer.start("main");
        int cnt = 10000;
        for (int i = 0; i < cnt; i++) {
            zc.sequence("name1");
        }

        log.info(" total records={} , time = {} ms , id = {}", cnt, timer.interval(), zc.sequence("name"));

    }

}
